package DAOImp;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import DAO.AbsHbnDao;
import DAO.ImageDAO;
import POJO.Image;

@Repository
public class ImageDaoImp extends AbsHbnDao<Image> implements ImageDAO{

	static final String FIND_IMAGE_LIKE = "FROM Image image WHERE image.imageUrl LIKE ?";
	
	@SuppressWarnings("unchecked")
	public List<Image> getImages(String name) {
		return getSession().createQuery(FIND_IMAGE_LIKE)
				.setString(0, "%" + name + "%")
				.list();
	}

}
